import { post } from '@/request/http'
import store from '@/store'

// 获取  场站列表  查询数据
export const getYardService = (data) =>
  post(
    '/FTKJWLHYPT/base/queryYard',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            tmnPrvoCode: data.tmnPrvoCode,
            tmnCtyCode: data.tmnCtyCode,
            tmnChnname: data.tmnChnname,
          }
        },
        Orderbys: {},
        PageIndexs: {
          FTKJWLHYPT: data.PageIndexs
        },
        PageSizes: {
          FTKJWLHYPT: data.PageSizes
        }
      }
    }
  )

// 获取  场站列表  新增
export const addYardService = (data) =>
  post(
    '/FTKJWLHYPT/base/addYard',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            tmnTyflag: data.tmnTyflag,
            tmnChnname: data.tmnChnname,
            tmnEgsname: data.tmnEgsname,
            tmnShrchn: data.tmnShrchn,
            tmnCoutry: data.tmnCoutry,
            tmnPrvoCode: data.tmnPrvoCode,
            tmnCtyeCode: data.tmnCtyeCode,
            tmnCtyCode: data.tmnCtyCode,
            tmnContacts: data.tmnContacts,
            tmnPhone: data.tmnPhone,
            tmnPorts: data.tmnPorts,
            tmnX: data.tmnX,
            tmnY: data.tmnY,
            tmnAddress: data.tmnAddress,
            tmnRemark: data.tmnRemark,
            tmnDepId: store.state.user.DPTID_DX_H,
            staFltuuid: store.state.user.FLT_UUID_DX_H,
            tmnInsertuser: store.state.user.USR_CODE_DX_H,
          }
        }
      }
    }
  )

// 获取  场站列表  编辑
export const editYardService = (data) =>
  post(
    '/FTKJWLHYPT/base/editYard',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            tmnCode: data.tmnCode,
            tmnTyflag: data.tmnTyflag,
            tmnChnname: data.tmnChnname,
            tmnEgsname: data.tmnEgsname,
            tmnShrchn: data.tmnShrchn,
            tmnCoutry: data.tmnCoutry,
            tmnPrvoCode: data.tmnPrvoCode,
            tmnCtyeCode: data.tmnCtyeCode,
            tmnCtyCode: data.tmnCtyCode,
            tmnContacts: data.tmnContacts,
            tmnPhone: data.tmnPhone,
            tmnPorts: data.tmnPorts,
            tmnX: data.tmnX,
            tmnY: data.tmnY,
            tmnAddress: data.tmnAddress,
            tmnRemark: data.tmnRemark,
            tmnLstupduser: store.state.user.USR_CODE_DX_H,
            tmnDepId: store.state.user.DPTID_DX_H,
          }
        }
      }
    }
  )

// 获取  场站列表  删除
export const delYardService = (data) =>
  post(
    '/FTKJWLHYPT/base/delYard',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            tmnCode: data.tmnCode,
          }
        }
      }
    }
  )

// 获取  码头堆场  所属港口
export const getPortSelectService = () =>
  post(
    '/FTKJWLHYPT/dropDown/getPortsInfoByDptId',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {

          }
        }
      }
    }
  )

// 获取  码头堆场  区县下拉
export const getAreaService = (data) =>
  post(
    '/FTKJWLHYPT/dropDown/getDistrict',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            prvCode: data.prvCode,
            ctyeCode: data.ctyeCode,
          }
        }
      }
    }
  )
